package com.amphiprion.prototype.component.animation;

public class AlplaComponentAnimation extends GameComponentAnimation {
	private float startAlpha;
	private float endAlpha;

	public AlplaComponentAnimation(long duration, long delay, int startAlpha, int endAlpha) {
		this(duration, delay, startAlpha, endAlpha, false, false);
	}

	public AlplaComponentAnimation(long duration, long delay, int startAlpha, int endAlpha, boolean loop, boolean forwardAndBack) {
		this.delay = delay;
		this.startAlpha = startAlpha;
		this.endAlpha = endAlpha;
		this.duration = duration;
		this.loop = loop;
		this.forwardAndBack = forwardAndBack;
	}

	@Override
	protected void onUpdate(float progress) {
		cmp.setAlpha((int) ((endAlpha - startAlpha) * progress + startAlpha));
	}

	@Override
	public void start() {
	}

}
